package com.why.remote;

import com.github.pagehelper.PageInfo;
import com.why.dto.NhDto;
import com.why.pojo.OldMan;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;

public interface ChuRuYuanRemote {
    /**
     * 出院和外出申请
     * @param id
     * @return
     */
    @RequestMapping("/chuyuansq")
    NhDto<String>chuyuansq(@RequestParam("id")Integer id,@RequestParam("status")Integer status);

    /**
     * 外出同意/反院同意
     * @param id
     * @param status 1,反院。3,外出
     * @return
     */
    @RequestMapping("/waichujd")
    NhDto<String>waichujd(@RequestParam("id")Integer id,@RequestParam("status")Integer status);

    /**
     * 查看老人表
     * @param pageNum
     * @param pageSize
     * @param a 1.查看入住老人，2.查看出院老人，3.查看外出老人，4查看出院申请的老人,5.查看外出申请老人
     * @return
     */
    @RequestMapping("/chuyuanselect")
    NhDto<PageInfo<OldMan>>chuyuanselect(@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize,@RequestParam("a")int a,@RequestParam("userName")String userName);
    /**
     * 同意出院
     * @param id
     * @return
     */
    @RequestMapping("/chuyuanty")
    NhDto<String>chuyuanty(@RequestParam("id")Integer id);


    /**
     * 上传身份证
     * @param file
     * @return
     */
    @RequestMapping(value = "/card",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    NhDto<String> card(@RequestPart("file") MultipartFile file);

    /***
     * 提交申请入住
     * @param map
     * @return
     */
    @RequestMapping("/churuyuanok")
    NhDto<String>churuyuanok(@RequestBody HashMap map);

    /**
     * 同意申请入住
     * @param id
     * @return
     */
    @RequestMapping("/tyruzhu")
    NhDto<String>tyruzhu(@RequestParam("id") int id);
}
